| Conditions | 1 |
| Paths | 1 |
| Total Lines | 28 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | var chai = require('chai'); |
||
| 15 | describe('Sql', function() { |
||
| 16 | before( function(done) { |
||
| 17 | Manager.instance.init() |
||
| 18 | .then(function () { |
||
| 19 | this.fixture = { |
||
| 20 | articleJsoninline: fse.readFileSync(path.join(process.cwd(), 'test', 'fixtures', 'templates', 'article-data-jsoninline.html'), 'utf8'), |
||
| 21 | articleArrayinline: fse.readFileSync(path.join(process.cwd(), 'test', 'fixtures', 'templates', 'article-data-arrayinline.html'), 'utf8') |
||
| 22 | } |
||
| 23 | done() |
||
| 24 | |||
| 25 | }.bind(this)) |
||
| 26 | }); |
||
| 27 | |||
| 28 | /** |
||
| 29 | * |
||
| 30 | * |
||
| 31 | */ |
||
| 32 | it('cmsData.sql.getDataSource', function() { |
||
| 33 | var obj = {key:'titles'} |
||
|
|
|||
| 34 | var json = {abe_source:{}} |
||
| 35 | var jsonString = cmsData.sql.getDataSource(this.fixture.articleJsoninline) |
||
| 36 | chai.expect(jsonString.indexOf('rouge')).to.be.above(-1); |
||
| 37 | JSON.parse(jsonString) |
||
| 38 | jsonString = cmsData.sql.getDataSource(this.fixture.articleArrayinline) |
||
| 39 | chai.expect(jsonString.indexOf('rouge')).to.be.above(-1); |
||
| 40 | JSON.parse(jsonString) |
||
| 41 | }); |
||
| 42 | }); |
||
| 43 |